package net.homelinux.chaoswg.io.renga.krypto.operations.misc;

import net.homelinux.chaoswg.io.higherorderfunctions.AbstractTernaryFunction;
import net.homelinux.chaoswg.io.higherorderfunctions.TernaryFunction;
import net.homelinux.chaoswg.io.renga.krypto.datatypes.numerical.UnsignedNBit;

public class Select extends AbstractTernaryFunction<Object, UnsignedNBit, Object, Object> implements TernaryFunction<Object, UnsignedNBit, Object, Object> {

    public Object apply(final UnsignedNBit arg0, final Object arg1, final Object arg2) {
        return arg0.getValue().equals(arg0.MIN) ? arg1 : arg2;
    }

}
